<template>
  <view class="bottom-nav">
    <view class="nav-item" v-for="nav in navs" :key="nav.name" :class="{ active: nav.active }" @tap="$emit('tabChange', nav)">
      <uv-icon :name="nav.icon" size="32" :color="nav.active ? '#7ED0A1' : '#888'" />
      <text>{{ nav.name }}</text>
    </view>
  </view>
</template>

<script setup>
const props = defineProps({
  navs: {
    type: Array,
    required: true
  }
})
</script>

<style scoped>
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 90rpx;
  background: #fff;
  display: flex;
  border-top: 1rpx solid #eee;
  z-index: 999;
}
.nav-item {
  flex: 1;
  text-align: center;
  padding: 8rpx 0 0 0;
  color: #888;
  font-size: 18rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.nav-item .uv-icon {
  margin-bottom: 2rpx;
}
.nav-item.active {
  color: #7ED0A1;
}
.nav-item.active text {
  color: #7ED0A1;
}
</style> 